<?php require_once('./Connections/microassur.php'); ?>
<?php 
	if(!isset($_SESSION))
	{
	  session_start();
	}
	function today()
	{
		$jour = array("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi");
		$mois = array("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre");
		echo @$jour[date(w)]." ".@date(j)." ".@$mois[date(n)-1]." ".@date(Y);
	}
	function isHabilitation($hab)
	{
		$hostname_microassur = "mysql5-8.pro";
		$database_microassur = "conseileademo4";
		$username_microassur = "conseileademo4";
		$password_microassur = "hD8jhER1";
		$microassur = mysql_pconnect($hostname_microassur, $username_microassur, $password_microassur) or trigger_error(mysql_error(),E_USER_ERROR); 
		mysql_select_db($database_microassur, $microassur);
		$colname_rs = "-1";
			if (isset($_SESSION['MM_UserGroup'])) 
			{
				$colname_rs = $_SESSION['MM_UserGroup'];
			}
		mysql_select_db($database_microassur, $microassur);
		$query_rs = sprintf("SELECT * FROM habilitation WHERE Identifiant_profil = %s", GetSQLValueString($colname_rs, "int"));
		$rs = mysql_query($query_rs, $microassur) or die(mysql_error());
		$row_rs = mysql_fetch_assoc($rs);
		$totalRows_rs = mysql_num_rows($rs);
		$n=0;
		
		do {
				if($row_rs['Libelle_evenement']==$hab) $n+=1; 
			} while ($row_rs = mysql_fetch_assoc($rs));
			
		if($n==0) return 'style="display:none"' ; 
	}
?>